#!/usr/bin/bash
#crontab set: * * 1 * * /export/home/huimin/test/rmondate/rmondate.sh /home/huimin/>>/export/home/huimin/test/rmondate/rm.log 
#./rmondate [path]
date=`date +%Y%m%d`
echo "---------`date +%Y%m%d:%H%M%S`---------" 
date=`expr $date - 1`
if [ $1 ]
then
    fpath=$1\/$date
else
    fpath=$date
fi
#echo $fpath

if [ -d $fpath ]
then
    rm -rf $fpath
    echo "rm $fpath"
else
    echo "$fpath not found"
fi

